package com.sh4.wxpay;

import java.io.ByteArrayInputStream;
import java.io.File;
import java.io.FileInputStream;
import java.io.InputStream;

public class WxConfig extends WXPayConfig{
	
	private byte[] certData; //证书信息
	
	public WxConfig() throws Exception {
        String certPath = "/path/to/apiclient_cert.p12";
        File file = new File(certPath);
        InputStream certStream = new FileInputStream(file);
        this.certData = new byte[(int) file.length()];
        certStream.read(this.certData);
        certStream.close();
    }

	@Override
	String getAppID() {
		// TODO Auto-generated method stub
		return "";
	}

	@Override
	String getMchID() {
		// TODO Auto-generated method stub
		return "";
	}

	@Override
	String getKey() {
		// TODO Auto-generated method stub
		return "";
	}

	/***
	 * 获取证书流
	 */
	@Override
	InputStream getCertStream() { 
		ByteArrayInputStream certBis = new ByteArrayInputStream(this.certData);
        return certBis;
	}

	@Override
	IWXPayDomain getWXPayDomain() {
		// TODO Auto-generated method stub
		return null;
	}

}
